<?php
/**
 * +--------------------------------------------------------+
 * @Created by Phpstorm.
 * @Category 2022_07_01_134500_create_stock_peas_table.php
 * @Depiction
 * @Author hwy <429208948@qq.com>
 * @Date 2022/4/30  15:07
 * +--------------------------------------------------------+
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

class CreateStockPeasTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('stock_peas', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('stock_id');
            $table->dateTime('date')->nullable();
            $table->string('pe', 10)->default(0)->comment('市盈率');
            $table->string('pb', 10)->default(0)->comment('市净率');
            $table->string('dv', 10)->default(0)->comment('股息率');
            $table->string('market_value', 20)->default(0)->comment('市值');
            $table->string('price', 20)->default(0)->comment('价格');
            $table->timestamps();
        });

        DB::statement("ALTER TABLE `la_stock_peas` comment 'stock数据'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('la_stock_peas');
    }
}

